2025-12-22 Bash Shell Tricks _Meine

Bash Shell Tricks Tutorial

Stringlänge ermittelnlength=${#tempfullname}
Entfernung letztes zeichen aus string #5+ Tiptemptelefon=$(echo ${temptelefon::length-1})
Debuggingtrail of variable and meta-character expansion. You can enable variable expansion to POSIX and Bourne shell scripts when you execute the script by typing:

trail of variable and meta-character expansion. You can enable variable expansion to POSIX and Bourne shell scripts when you execute the script by typing:

% sh -v script
% sh -x script

You can also turn this feature on and off inside the script. To turn on the verbose flag, use
set -v

to turn on the echo variable, use:
set -x

If you want to turn these variables off, use a plus instead of a minus:

set +x
set +v

Test auf Neuer 0der Aelter Inode

                #DATEI1 –ef DATEI2 Datei1 und Datei2 haben dieselbe Geräte- und Inodennummer und sind somit Hardlinks.
                #DATEI1 –nt DATEI2 Datei1 ist neueren Datums (Modifikationsdatum, nt = newer time) als Datei2.
                #DATEI1 –ot DATEI2 Datei1 ist älter aelter (Modifikationsdatum, ot = older time) als Datei2. Vergleich _Tip _5+